Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add known-bug tests for 11 unsound issues #110480

Merged

Conversation

@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 18, 2023
Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a comment on the header comments.

For other issues, feel free to add them here, or you can open separate PRs.

Comment on lines 1 to 8
// submitted by @aturon: The combination of variance and implied bounds for
// nested references opens a hole in the current type system
// known-bug: #25860
// check-pass
// unsoundness issue: should-fail

// mcve from @pnkfelix
// https://github.com/rust-lang/rust/issues/25860#issue-82044592
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably too much here. Here's what I would write:

// check-pass
// known-bug #23860

// Should fail. The combination of variance and implied bounds for
// nested references allows us to infer a longer lifetime than we can prove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, thanks! Updated.

@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch from 66b3ae7 to a535aa8 Compare April 18, 2023 05:57
@whtahy
Copy link
Contributor Author

whtahy commented Apr 18, 2023

Hmm, I'm thinking I should open a new pull request, since it looks like issue # in commit msg is spamming the issues?

@rust-log-analyzer

This comment has been minimized.

@kadiwa4
Copy link
Contributor

kadiwa4 commented Apr 18, 2023

You can squash your commits and edit the message on the way

@jackh726
Copy link
Member

Yeah, are you able to squash the commits into just one? And then you can edit the message to not tag the issue (just make the commit message like "add known-bug test for issue 25860).

Then, we can tag the issue in the PR description.

Then, if you want to add more tests, basically repeat, with one test per commit? (But I'm happy to merge with one test and followup later with others if you're interested)

@whtahy
Copy link
Contributor Author

whtahy commented Apr 18, 2023

You can squash your commits and edit the message on the way

Yes! This is great, thanks.

Yeah, are you able to squash the commits into just one? And then you can edit the message to not tag the issue (just make the commit message like "add known-bug test for issue 25860).

Then, if you want to add more tests, basically repeat, with one test per commit?

Sounds good, will do.

Then, we can tag the issue in the PR description.

Ah, so I should edit the top comment after all the tests are in?

I appreciate the help. Let me know if there's anything else.

@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch from d8c832f to 7f7f00c Compare April 18, 2023 22:17
@whtahy whtahy marked this pull request as draft April 18, 2023 22:29
@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch from 7f7f00c to 7cd2696 Compare April 18, 2023 22:30
@jackh726
Copy link
Member

Ah, so I should edit the top comment after all the tests are in?
I'm not sure if github will relink when editing the comment or not. So up to you. (I'm also about to review and can tag them if I r+)

I appreciate the help. Let me know if there's anything else.

Of course! Thanks for the contribution.

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits on one test then LGTM.

@@ -0,0 +1,28 @@
// check-pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test isn't in the right place (impl-trait tests are for impl Trait syntax).

Maybe just under tests/ui/coherence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, moved to tests/ui/coherence as suggested.

Comment on lines 8 to 9
// Coherence = given a trait and some set of types for its type parameters,
// there should be *exactly one* impl that applies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, removed.

@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch 2 times, most recently from 9b33d6b to af3a6be Compare April 21, 2023 02:55
@whtahy whtahy marked this pull request as ready for review April 21, 2023 03:02
@whtahy
Copy link
Contributor Author

whtahy commented Apr 21, 2023

Alright! Hopefully good to go.

  • updated and squashed the 1 test
  • added issues to PR description

@@ -0,0 +1,68 @@
// check-pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agh just saw that this test is not in the right place. Let's just put it under tests/ui/typeck or tests/ui/issues. (tests/ui/deref would be nicer, but not worth creating a whole directory for only one test)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, moved to tests/ui/typeck.

@@ -0,0 +1,15 @@
// check-pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also move this to tests/ui/closures, static is for static items, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, moved to tests/ui/closures.

@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch from af3a6be to 5674295 Compare April 22, 2023 04:47
@whtahy whtahy force-pushed the 105107/known-bug-tests-for-unsound-issues branch from 5674295 to 3c5de9a Compare April 22, 2023 04:52
@whtahy whtahy marked this pull request as ready for review April 22, 2023 17:58
@whtahy
Copy link
Contributor Author

whtahy commented Apr 22, 2023

Added 4 new tests and updated PR description. That's all the tests for this PR. Happy to make changes, move things around, etc.

@whtahy whtahy changed the title #105107: add known-bug test for unsound issue #25860 Add known-bug tests for 11 unsound issues Apr 22, 2023
@jackh726
Copy link
Member

Thanks! This is great.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 23, 2023

📌 Commit ebe61ce has been approved by jackh726

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 23, 2023
…unsound-issues, r=jackh726

Add `known-bug` tests for 11 unsound issues

r? `@jackh726`

Should tests for other issues be in separate PRs?  Thanks.

Edit: Partially addresses rust-lang#105107.  This PR adds `known-bug` tests for 11 unsound issues:
- rust-lang#25860
- rust-lang#49206
- rust-lang#57893
- rust-lang#84366
- rust-lang#84533
- rust-lang#84591
- rust-lang#85099
- rust-lang#98117
- rust-lang#100041
- rust-lang#100051
- rust-lang#104005
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 24, 2023
…unsound-issues, r=jackh726

Add `known-bug` tests for 11 unsound issues

r? ``@jackh726``

Should tests for other issues be in separate PRs?  Thanks.

Edit: Partially addresses rust-lang#105107.  This PR adds `known-bug` tests for 11 unsound issues:
- rust-lang#25860
- rust-lang#49206
- rust-lang#57893
- rust-lang#84366
- rust-lang#84533
- rust-lang#84591
- rust-lang#85099
- rust-lang#98117
- rust-lang#100041
- rust-lang#100051
- rust-lang#104005
@jackh726
Copy link
Member

note to self: need to add S-bug-has-test to the issues covered by this PR when this lands

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 24, 2023
…unsound-issues, r=jackh726

Add `known-bug` tests for 11 unsound issues

r? `@jackh726`

Should tests for other issues be in separate PRs?  Thanks.

Edit: Partially addresses rust-lang#105107.  This PR adds `known-bug` tests for 11 unsound issues:
- rust-lang#25860
- rust-lang#49206
- rust-lang#57893
- rust-lang#84366
- rust-lang#84533
- rust-lang#84591
- rust-lang#85099
- rust-lang#98117
- rust-lang#100041
- rust-lang#100051
- rust-lang#104005
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 24, 2023
…unsound-issues, r=jackh726

Add `known-bug` tests for 11 unsound issues

r? ``@jackh726``

Should tests for other issues be in separate PRs?  Thanks.

Edit: Partially addresses rust-lang#105107.  This PR adds `known-bug` tests for 11 unsound issues:
- rust-lang#25860
- rust-lang#49206
- rust-lang#57893
- rust-lang#84366
- rust-lang#84533
- rust-lang#84591
- rust-lang#85099
- rust-lang#98117
- rust-lang#100041
- rust-lang#100051
- rust-lang#104005
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 24, 2023
…unsound-issues, r=jackh726

Add `known-bug` tests for 11 unsound issues

r? `@jackh726`

Should tests for other issues be in separate PRs?  Thanks.

Edit: Partially addresses rust-lang#105107.  This PR adds `known-bug` tests for 11 unsound issues:
- rust-lang#25860
- rust-lang#49206
- rust-lang#57893
- rust-lang#84366
- rust-lang#84533
- rust-lang#84591
- rust-lang#85099
- rust-lang#98117
- rust-lang#100041
- rust-lang#100051
- rust-lang#104005
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2023
Rollup of 10 pull requests

Successful merges:

 - rust-lang#110480 (Add `known-bug` tests for 11 unsound issues)
 - rust-lang#110539 (Move around `{Idx, IndexVec, IndexSlice}` adjacent code)
 - rust-lang#110590 (Add some tests around (lack of) object safety of associated types and consts)
 - rust-lang#110602 (Ignore src/bootstrap formatting commit in .git-blame-ignore-revs)
 - rust-lang#110667 (pointer-auth-link-with-c: Fix cross compilation.)
 - rust-lang#110681 (drop few unused crates, gate libc under unix for rustc_codegen_ssa)
 - rust-lang#110685 (Some cleanups to DataflowConstProp)
 - rust-lang#110744 (bootstrap: update paths cargo-credential crate)
 - rust-lang#110750 (Add size asserts for MIR `SourceScopeData` & `VarDebugInfo`)
 - rust-lang#110760 (rustdoc: Add regression test for rust-lang#60522)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 42467d5 into rust-lang:master Apr 24, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 24, 2023
@whtahy whtahy deleted the 105107/known-bug-tests-for-unsound-issues branch April 25, 2023 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants